export const getBase64 = file => {
    const reader = new FileReader();
    reader.readAsDataURL(file);
    return new Promise((resolve) => {
        reader.onload = () => {
            resolve(reader.result);
        };
    });
};

export const getPixel = img => {
    const image = new Image();
    image.src = img;
    return new Promise((resolve) => {
        image.onload = () => {
            const width = image.width;
            const height = image.height;
            resolve({ width, height });
        };
    });
}